rbd/action/Snap.cc

##create/add

  open_image / open_image_by_id
   RBD::open 
   ImageState::open  除了trash remove 和list children 默认都会打开父卷
   ImageCtx.op_work_queue 执行handle_open  op_work_queue的设计看起来为了image的op操作在单个imagectx上需要串行回调
     
  snap_set


SnapshotRemoveRequest::send_release_snap_id
librados::IoCtxImpl::selfmanaged_snap_remove
Objecter::delete_selfmanaged_snaps
  POOL_OP_DELETE_UNMANAGED_SNAPS
  POOL_OP_DELETE_UNMANAGED_SNAP

SnapshotCreateRequest<I>::send_allocate_snap_id
selfmanaged_snap_create
Objecter::create_selfmanaged_snaps
  POOL_OP_CREATE_UNMANAGED_SNAPS

pg_pool_t {
  removed_snaps;
  pg_pool_t::remove_unmanaged_snap (add to removed_snaps)
  pg_pool_t::add_unmanaged_snap  (not effect on removed_snaps)
}

struct PGPool {
  interval_set<snapid_t> cached_removed_snaps;      // current removed_snaps set
  interval_set<snapid_t> newly_removed_snaps;  // newly removed in the last epoch
}

写入 
客户端snapshotremove.cc删除更新到monitor.并通过paxos更新到osdmap。
removed_snaps
 OSDMap
  propagate_snaps_to_tiers 更新
 OSDMonitor
  OSDMonitor::prepare_pool_op
  wait_for_finished_proposal


更新osdmap到当前pg的removed_snaps
OSD::process_peering_events
OSD::advance_pg
PG::handle_advance_map
PGPool::update
PG

 osd pool mksnap
  pg_pool_t::add_snap
  
queue_for_snap_trim
PrimaryLogPG::AwaitAsyncWork::react(const DoSnapWork&)
PrimaryLogPG::trim_object


PrimaryLogPG::AwaitAsyncWork::react
 snapid删除到没有对象的时候，会加入到pg_info.purged_snaps. (这里真是完成purge的)
 并将snapid从PG.snap_trimq移除


PG::snap_trimq

PG::activate
